<?php
	require "../dao/course_dao.php";
	require "../dao/college_dao.php";
	require "../dao/grade_dao.php";
	require "../dao/class_dao.php";
	
	$colleges = selectAllcolleges();
	$grades = selectAllgrades();
	$classes = selectAllclasses();
	
	$sec_puls = selectCouInformationBypul();
	$sec_spes = selectCouInformationByspe();
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>学生公共/专业课选择</title>
		<link rel="stylesheet" href="../css/register.css"/>
		<script src='../js/jquery-1.2.6.min.js'></script>
		<style>
			select{
				width:260px;
				margin:0 16px;
			}
			span{
				width:180px;
			}
			#sections{
				width:850px;
				height:180px;
				border:1px solid #000;
				margin:0 auto;
				overflow: auto;
			}
			input[type="checkbox"]{
				width:30px;
				height:30px;
				margin-right:10px;
			}
			ul{
				width:100%;
				height:100%;
				padding:5px;
			}
			li{
				list-style: none;
				display: inline-block;
				width:270px;
				height:50px;
				font-size:16px;
				box-shadow: 1px 1px 1px #fff;
				vertical-align: middle;
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<form action="S_insertStu_section_server.php" method="POST" autocomplete="off">
				<select name="sec_collegeid">
					<option value="0">--请选择学院--</option>
					<?php
						foreach($colleges as $college){
							echo "<option value='{$college["collegeid"]}'>{$college["collegename"]}</option>";
						}	
					?>
				</select>
				<select name="sec_gradeid">
					<option value="0">--请选择年级--</option>
					<?php
						foreach($grades as $grade){
							echo "<option value='{$grade["gradeid"]}'>{$grade["gradename"]}</option>";
						}	
					?>
				</select>
				<select name="sec_classid">
					<option value="0">--请选择班级--</option>
					<?php
						foreach($classes as $class){
							echo "<option value='{$class["classid"]}'>{$class["classname"]}</option>";
						}	
					?>
				</select>
				
				<br />
				
				<span>公共课程选择</span>
				<div id="sections">
					<ul>
						<?php
							foreach($sec_puls as $course){
								echo "
										<li>
											<input type='checkbox' name='spepul_sections[]' value='{$course["tid"]}' checked/>{$course["coursename"]}({$course["tname"]}老师)
										</li>
									";
							}	
						?>
					</ul>
				</div>
				
				<span>专业课程选择</span>
				<div id="sections">
					<ul>
						<?php
							foreach($sec_spes as $course){
								echo "
										<li>
											<input type='checkbox' name='spepul_sections[]' value='{$course["tid"]}' />{$course["coursename"]}({$course["tname"]}老师)
										</li>
									";
							}	
						?>
					</ul>
				</div>
				
				<input type="reset" value="重   置" />
				<input type="submit" value="添   加"/>
			</form>
		</div>
		
	</body>
</html>